<?php
require_once('config/lang/eng.php');
require_once('tcpdf.php');

class Pdf extends TCPDF {
	
	public function __construct($orientation='L', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false) {
		parent::__construct($orientation,$unit,$format,$unicode,$encoding,$diskcache,$pdfa);
	}
	
	public function Header() {

		
		// Logo
        // $image_file = K_PATH_IMAGES.'logo_example.jpg';
        //$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
        // Set font
        $this->SetFont('helvetica', 'B', 20);
        // Title
        $this->Cell(0, 15, $this->title, 0, false, 'C', 0, '', 0, false, 'M', 'M');

	}
	
	public function Footer() {
		// Position at 15 mm from bottom
        $this->SetY(-15);
        // Set font
        $this->SetFont('helvetica', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
        
        $dateCreated = new DateTime();
        $dateGenerated = "Date Generated : " . $dateCreated->format('Y-m-d H:i:s');
		$this->Cell(10,10,$dateGenerated, 0,0,'R');
	}

}